const http = require('http');
const readStaticFile = require('./readStaticFile');
const path = require('path');


http.createServer((req, res) => {
    const urlObj = new URL(req.url, 'http://localhost:8080');
    const pathname = path.join(__dirname, './public', urlObj.pathname);
    readStaticFile(res, pathname);
}).listen(8080)